package com.wgo.precise.client;

import java.net.URL;

import com.wgo.bpot.client.servicerequest.AbstractHessianRemoteServicesFactory;
import com.wgo.bpot.client.servicerequest.ServiceRequestor;
import com.wgo.bpot.domain.common.AuthenticationHandler;
import com.wgo.bpot.domain.common.UserCredential;
import com.wgo.precise.service.PreciseServices;

public class PreciseHessianRemoteServicesFactory extends AbstractHessianRemoteServicesFactory<PreciseServices> {
        
    public PreciseHessianRemoteServicesFactory(URL remoteUrl , AuthenticationHandler authenticationHandler){
        super(remoteUrl, authenticationHandler);
    }
    
    public PreciseServices createServices() {
        PreciseServices result = ServiceRequestor.createServicesStub(getRemoteServices(),PreciseServices.class, getAuthenticationHandler());
        return result;
    }

    public static PreciseHessianRemoteServicesFactory getDummyPreciseHessianRemoteServicesFactory(URL remoteUrl){
    	return new PreciseHessianRemoteServicesFactory(remoteUrl, new AuthenticationHandler(){
                public UserCredential createUserCredential() {
                    return new UserCredential("admin","admin");
                }
            });
    }
}
